import builtins from 'rollup-plugin-node-builtins';
import resolve from 'rollup-plugin-node-resolve';
import commonJS from 'rollup-plugin-commonjs'
import json from 'rollup-plugin-json';
import copy from 'rollup-plugin-copy'

export default [
  {
    input: './client/index.js',
    output: [{
      file: './public/static/js/client-bundle.js',
      name: 'Client',
      format: 'iife',
      sourcemap: 'inline'
    }],
    plugins: [
      json(),
      builtins(),
      resolve({
        browser: true
      }),
      
      copy({
        targets: [
          { src: ['./public/index.html', './public/favicon.ico'], dest: './dist' },
          { src: './public/static', dest: './dist' }
        ]
      }),

      commonJS({
        // include: ['node_modules/**','./server/config.js']
        include: ['node_modules/**']
      }),
    ]
  }
];
